<?php
namespace App\Lib;
class Option
{
    //操作结果常量

    const NO_RETURN             = 5;        //不需返回结果
    const LOGIN_TIMEOUT         = 4;        //登陆信息已过期
    const LOGIN_INCORRECT       = 3;        //登陆信息不正确
    const NULL_DATA             = 2;        //data数组为空
    const LASTEST_DATA          = 1;        //已是最新数据，不需下载

    const SUCCESS               = 0;        //操作成功
    const FAILED                = -1;       //操作失败

    const DATA_NOTALLOW          = 1;
    const DATA_NONEXISTENT      = -2;       //数据不存在
    const CORRECT_FORMAT        = -3;       //JSON格式不正确
    const FAILED_REDISAUTH      = -4;       //redis连接失败
    const DATAKEY_EXISTS        = -5;       //data_key已存在
    const REQUEST_TOOFAST       = -6;       //请求频率太高
    const REQUEST_REJECT_STRANGER = -7;     //对方拒绝接收陌生人消息
    const MISSING_PARAMETER     = -20;      //缺少参数
    const MISSING_OPERATION     = -100;     //缺少操作码
    const MISSING_MODULE        = -101;     //缺少模块码
    const USER_NONEXISTENT      = -201;     //用户不存在
    const PERMISSION_DENIED     = -202;     //用户无权限操作
    const LEAVE_GROUP           = -203;     //用户已离开讨论组
    const ACCOUNT_NONEXISTENT   = -301;     //账号不存在
    const USER_BEBLACKED        = -302;     //用户被拉黑
    const NOTE_DELETEED         = -303;     //内容被删除
    const APPID_BEFREEZED       = -401;     //APPID被冻结
    const UID_BEFREEZED         = -402;     //UID被冻结

    const OPERATION_TRUE                = true;     //操作结果，是
    const OPERATION_FALSE               = false;    //操作结果，否

    //json
    const JSON_TRUE             = true;     //是否JSON格式——正确
    const JSON_FALSE            = false;    //是否JSON格式——不正确

    //post_array
    const POSTARRAY_TRUE        = true;     //数据格式正确
    const POSTARRAY_FALSE       = false;    //数据格式不正确

    //login session
    const LOGIN_TRUE            = true;     //是否已登录——正确
    const LOGIN_FALSE           = false;    //是否已登录——不正确

    //qiniu token
    const QT_TRUE               = true;     //正确
    const QT_FALSE              = false;    //不正确

    //默认返回值
    const Req_Json_False_Ret    = '{"result":"-3","result_message":"JSON格式不正确"}';   //request json错误返回值



    //常用参数
    const EMPTY_STRING                  = "";       //空字符串
    const EMPTY_ARRAY                   = array();  //空数组
    const DATA_EXIST                    = 0;        //数据存在
    const DEFAULT_COUNT                 = 0;        //默认数字，0


    //数据是否
    const IS_TRUE                       = 1;        //是
    const IS_FALSE                      = 0;        //否

    const IS_FORWARD_FALSE              = 0;        //非转发
    const IS_FORWARD_TRUE               = 1;        //转发
    const IS_FORWARD_DELETE             = 2;        //转发已删除
    const DELETE_FORWARD_CONTENT        = "内容已被删除";     //转发内容被删除
    const CAN_FORWARD_FALSE             = 0;        //不可转发
    const CAN_FORWARD_TRUE              = 1;        //可转发


    const Return_Type_Original          = 0;
    const Return_Type_String            = 1;
    const Return_Type_Array             = 2;

    //socketk开始符和结束符
    const SOCKET_START_CHAR             = "\n";
    const SOCKET_END_CHAR               = "\n";


    //数据库查询结果
    const INSERT_FAILED         = -1;       //添加失败
    const UPDATE_SUCCESS        = 0;        //修改成功
    const UPDATE_FAILED         = -2;       //修改失败
    const SQL_IN_NONEXISTENT            = "0";      //sql语句，where xxx in (null)

    const OBJECT_TYPE_CREATEROOM    = 3;
    const OBJECT_TYPE_SENDCARD      = 1;
    const OBJECT_TYPE_RESIVE        = 2;
}

